<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  layout:decorator="layouts/layout" th:with="header='编辑库位', subtext='编辑指定库位数据'">

<head>
	<title>编辑库位</title>
</head>
<body>
	<th:block layout:fragment="content">
		<div class="box">
			<div class="box-body">
				<form id="locationForm" name="locationForm" th:object="${m}" th:action="@{|${baseUrl}/save${m.id==null?'':'/' + m.id}|}" method="post" class="form-horizontal" novalidate="novalidate">
					<input id="id" type="hidden" name="id" th:field="*{id}" />
					<input id="version" type="hidden" name="version" th:field="*{version}" />
					<div class="row line">
						<div class="col-lg-6">
							<h3 class="page-header">基本设置</h3>
						</div>
					</div>
				
                 		<div class="row">
							<div class="col-sm-6">
								<div class="form-group">
									<label class="control-label col-sm-3 mg-top-6 required">库位编码</label>
									<div class="col-sm-8 form-control-static">
										<input id="code" name="code" th:value="*{code}" maxlength="20" th:readonly="${not m.new}" class="form-control required" />
									</div>
								</div>
							</div>
					   </div>		
                 		<div class="row">
							<div class="col-sm-6">
								<div class="form-group">
									<label class="control-label col-sm-3 mg-top-6 ">描述</label>
									<div class="col-sm-8 form-control-static">
										<input id="name" name="name" th:value="*{name}" maxlength="100" class="form-control" />
									</div>
								</div>
							</div>
					   </div>		
                 	   <div class="row">
				          <div class="col-sm-6">
							<div class="form-group">
								<label class="control-label col-lg-3 required">库区</label>
								<div class="col-lg-8">
									<select id="zoneId" name="zoneId" class="form-control required">
										<option th:value="${m.zone != null ? m.zone.id : ''}" th:selected="${m.zone != null ? true : ''}">[[${m.zone != null ? m.zone.name : '请选择'}]]</option>
									</select>
								</div>
							</div>
				          </div>
          				</div>
          				<div class="row">
							<div class="col-sm-6">
					            <div class="form-group">
					              <label class="control-label col-sm-3 mg-top-6 required">库位类型</label>
					              <div class="col-sm-8 form-control-stati">
					                <select name="type" id="type" th:field="*{type}" class="form-control required">
					                  <option value="">请选择</option>
					                  <option th:each="a : ${@CODES.findByType('LOCATION_TYPE')}" th:value="${a.value}" th:text="${a.name}" />
					                </select>
					              </div>
							  </div>
			               </div>
			            </div>
                 		<div class="row">
							<div class="col-sm-6">	
							   <div class="form-group">
									<label class="control-label col-lg-3">排</label>
									<div class="col-lg-9">
										<input id="xCoord" name="xCoord" type="number"  min="0" max="1" th:value="*{xCoord}" class="form-control" />
									</div>
								</div>
					   		</div>	
					   </div>		
                 	   <div class="row">
							<div class="col-sm-6">	
							   <div class="form-group">
									<label class="control-label col-lg-3">列</label>
									<div class="col-lg-9">
										<input id="yCoord" name="yCoord" type="number"  min="0" max="50" th:value="*{yCoord}" class="form-control" />
									</div>
								</div>
					   		</div>	
					   </div>		
                 	   <div class="row">
							<div class="col-sm-6">	
							   <div class="form-group">
									<label class="control-label col-lg-3">层</label>
									<div class="col-lg-9">
										<input id="zZoord" name="zCoord" type="number"  min="0" max="10" th:value="*{zCoord}" class="form-control" />
									</div>
								</div>
					   		</div>	
					   </div>	
                 	   <div class="row">
							<div class="col-sm-6">
								<div class="form-group">
									<label class="control-label col-sm-3 mg-top-6 ">损坏</label>
									<div class="col-sm-8 form-control-static">
										<input id="demandFlag" name="demandFlag" th:value="*{demandFlag}" maxlength="20"
										class="form-control" />
									</div>
								</div>
							</div>
					   </div>		
                 	   <div class="row">
							<div class="col-sm-6">
								<div class="form-group">
									<label class="control-label col-sm-3 mg-top-6 ">上架顺序</label>
									<div class="col-sm-8 form-control-static">
										<input id="paSeqCode" name="paSeqCode" th:value="*{paSeqCode}" maxlength="20"
										class="form-control" />
									</div>
								</div>
							</div>
					   </div>		
					   <div class="row">
							<div class="col-sm-6">
					            <div class="form-group">
					              <label class="control-label col-sm-3 mg-top-6 ">库位状态</label>
					              <div class="col-sm-8 form-control-stati">
					                <select name="status" id="status" th:field="*{status}" class="form-control required">
					                  <option value="">请选择</option>
					                  <option th:each="a : ${@CODES.findByType('LOCATION_STATUS')}" th:value="${a.value}" th:text="${a.name}" />
					                </select>
					              </div>
							  </div>
			               </div>
			            </div>
					   
				  	    <div class="hr-line-dashed"></div>
						<div class="form-group">
							<div class="text-center">
								<a class="btn btn-default " th:href="@{|${baseUrl}|}"> 
								    <i class="fa fa-fw fa-reply"></i> 返回
								</a>
							</div>
						</div>		
				</form>
			</div>
		</div>
	</th:block>
	<th:block layout:fragment="scripts">
		<script th:replace="layouts/fragments/validatejs :: validate"></script>
		<script th:inline="javascript">
    	  // 后端传入前端使用的变量JS中定义
	      var oldCode = /*[[${m.code}]]*/'';
	      var oldName = /*[[${m.name}]]*/'';
    	</script>
		<script th:src="@{|${theme}/js/app/master/location_form.js?v=${applicationVersion}|}" th:inline="javascript"></script>
	</th:block>
</body>

</html>